/**
 * 学校管理目录树
 * @type 
 */
var chnRootNode=[
                 {code:100000, id:1, name:"学校", isParent:true, type:0}
     ];
 var setting = {
			view: {
	        	showTitle: false,
		        dblClickExpand: false,
		        showLine: false
		     },
			async : {
				enable : true,
				url : getUrl
			},
			callback : {
				onClick : zTreeNodeOnClick
				//onAsyncSuccess: zTreeOnAsyncSuccess

			}
		};
 function getUrl(treeId,treeNode){
	// if(1 == treeNode){
	 	
	   	 return "manage/schManage_getAreaSchoolListData.action?parentId="+treeNode.id+"&rdm="+Math.random();
	 //}else{
	 
	//	 return "manage/schManage_getSchoolsInAreaTree.action?parentId="+treeNode.id+"&rdm="+Math.random();
	// }
 };
 /**
  * 单击节点
  * @param event
  * @param treeId
  * @param treeNode
  */
function zTreeNodeOnClick(event, treeId, treeNode) {//响应节点点击事件

	var zTree = $.fn.zTree.getZTreeObj("schooltree");
	zTree.expandNode(treeNode);//展开节点
	//if(treeNode.type == 0)
	  //  return;
	 var listFrame = window.parent.document.getElementById("list_iframe");
	 var nodeType = treeNode.type;
	 listFrame.src="manage/teacher_list.action?orgId="+treeNode.id+"&nodeType="+nodeType+"&rdm="+Math.random();
 };
 /**
  * 初始化 加载Tree
  */
 $(document).ready(function(){
	 // $.fn.zTree.init($("#schooltree"), setting, chnRootNode);
	   zTreeInit("schooltree" ,false,true,null,null,1);
 });